﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using nwrole.plugin;

namespace nwrole.lib {
    [ServiceContract]
    public interface ISupervisorContract {
        [OperationContract]
        Result Start();

        [OperationContract]
        Result Stop();

        [OperationContract]
        SupervisorData GetSupervisorData();

        [OperationContract]
        int GetNumServices();

        [OperationContract]
        ServiceData[] GetServices();

        [OperationContract]
        Result RestartService(Guid serviceId);

        [OperationContract]
        Result StopService(Guid serviceId);

        [OperationContract]
        Result StartService(Guid serviceId);

        [OperationContract]
        Result RestartPlugin(Guid serviceId, Guid pluginId);

        [OperationContract]
        Result StopPlugin(Guid serviceId, Guid pluginId);

        [OperationContract]
        Result StartPlugin(Guid serviceId, Guid pluginId);

        [OperationContract]
        PluginData[] GetServicePluginsData(Guid serviceId);

        [OperationContract]
        PluginState? GetServicePluginState(Guid serviceId, Guid pluginId);

        [OperationContract]
        Dictionary<string, object> GetPluginProviderSettings();

        /*[OperationContract]
        void LogService(Guid serviceId, LogLevel level, string msg, Exception ex);

        [OperationContract]
        void LogPlugin(Guid pluginId, LogLevel level, string msg, Exception ex);*/

        [OperationContract]
        void Log(NwroleObjectType objectType, Guid pluginId, LogLevel level, string message, Exception ex);

        [OperationContract]
        void RegisterPlugin(Guid serviceId, Guid pluginId, string displayName);

        [OperationContract]
        void PulseService(Guid id, string serviceName, string message);

        [OperationContract]
        void PulsePlugin(Guid id, string pluginName, string message);

        [OperationContract]
        ServicePulse GetServicePulse(Guid serviceId);

        [OperationContract]
        PluginPulse GetPluginPulse(Guid pluginId);

        [OperationContract]
        void EmailResponsible(string subject, string message);
    }
}
